package com.webank.weideagroup2.web.ctrl;

import com.alibaba.fastjson.JSONObject;
import com.webank.weideagroup2.bean.ResultBean;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Create Time: 2018年07月28日 17:27
 *
 * @author fin
 */
@RequestMapping("/api/login")
@RestController
public class UserCtrl {

    @RequestMapping("")
    public ResultBean login(@RequestBody JSONObject body) {
        String userName = body.getString("userName");
        String type = userName.substring(0, 1);
        JSONObject json = new JSONObject();
        json.put("type", type);
        json.put("platform", userName);

        ResultBean resultBean = new ResultBean();
        resultBean.setData(json);
        return resultBean;
    }
}
